package com.sxt.sys.utils;

import java.util.UUID;

import org.apache.shiro.crypto.hash.Md5Hash;

public class Md5Utils {
	

	
	
	/**
	 * 生成随机盐
	 */
	public static String createRandomStr() {
		return UUID.randomUUID().toString().replace("-", "").toUpperCase();
	}
	/**
	 * 生成md5密文
	 * @param source
	 * @param salt
	 * @param hashIterations
	 * @return
	 */
	public static String md5(String source, Object salt, Integer hashIterations) {
		return new Md5Hash(source, salt, hashIterations).toString();
	}


}
